﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public sealed partial class NetworkManager : NetworkProcessMain
{
    //private SimpleSelectPopup WaitResponsePopup;
    private static NetworkManager instance = null;
    public static NetworkManager Instance
    {
        get
        {
            if (instance == null)
            {
                instance = GameObject.FindObjectOfType<NetworkManager>();
                if( instance == null ) {
                    GameObject manager = new GameObject("_NetworkManager", typeof(NetworkManager));

                    instance = manager.GetComponent<NetworkManager>();
                    instance.SetConnectIPPort(Settings.Instance.ServerUrl);//131125 hikim
                }
            }
            return instance;
        }
    }
	void Awake(){
		Initialize();

        GameObject.DontDestroyOnLoad(gameObject);
	}

	public void ResponseGetServerTime(ResponseModel<double> result)
	{
		Debug.LogError(result.data);
	}

    /// <summary>
    /// HTTP 에러시, 호출되는 함수.
    /// </summary>
    /// <param name="strError"></param>
    protected override void OutputWWWError(string strError, NetMsg msg)
    {
        Debug.LogError(strError);
		/*
        SimpleSelectPopup popup = PopupManager.Inst.Open<SimpleSelectPopup>();
        popup.Text = string.Format(
            "서버와의 통신에 실패하였습니다!\n[FF0000][error : {0}][-]", strError);

        popup.transform.localPosition = Vector3.back * 400.0f;
        popup.AddOnOKBtn(OnRetry);
        popup.AddOnCancelBtn(OnDontRetry);
        popup.OkButtonText = "Retry";
        popup.CancelButtonText = "Exit";
        */
        
        //TODO:TEMP-통신 장애시 임시 처리(140729 hikim)
        mQueSendMsg.Clear();
        mTransmitStatus = 0;
        Popup_OneButton sc = PopupManager.PushPopup(PopupKind.OneButton) as Popup_OneButton;
        sc.SetPopupWithTitleAndBody("Error", "Network error");
        return;
    }

    /// <summary>
    /// 서버에서 받은 메세지가 에러 코드일때.
    /// </summary>
    /// <param name="nErrorCode"></param>
    /// <param name="msg"></param>
    protected override void OutputServerError(int nErrorCode)
    {
		//PopupManager.Inst.OpenServerErrorPopup(nErrorCode);
    }

    /// <summary>
    /// 서버 응답을 기다리기 시작하는 시점에 실행되는 함수.
    /// </summary>
    protected override void WaitServerResponse()
    {
        SceneController.SC.SetLoadingActive(true);
    }

    /// <summary>
    /// 서버 응답을 받고 난후 실행되는 함수
    /// </summary>
    protected override void ReceiveServerResponse()
    {
        SceneController.SC.SetLoadingActive(false);
    }

    /// <summary>
    /// 재전송 프로세스 진행
    /// </summary>
    private void OnRetry( GameObject obj )
    {
        //PopupManager.Inst.Close();
        RetryTransmit();
    }

    /// <summary>
    /// 재전송을 실패로 처리하고 다음 패킷 처리.
    /// </summary>
    private void OnDontRetry( GameObject obj )
    {
        TransmitCompleteTheProcess();
    }

	public void C2S_GET_SERVERTIME(System.Action<ResponseModel<double>> Callback)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<double>);
		msg.IsShowError = false;
		
		PT_C2S_GET_SERVERTIME dataPush = new PT_C2S_GET_SERVERTIME();
		
		dataPush.Reset();
		
		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
	}

    public void C2S_CHEAT_COMMON_MSG(string url, System.Action<ResponseModel<object>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<object>);
        msg.IsShowError = false;

        PT_C2S_CHEAT_COMMON_MSG dataPush = new PT_C2S_CHEAT_COMMON_MSG();

        dataPush.Reset();
        dataPush.MsgID = url;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

	public void C2S_CHEAT_ADD_REWARD_MSG(System.Action<ResponseModel<object>> Callback)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<object>);
		msg.IsShowError = false;
		
		PT_C2S_CHEAT_ADD_REWARD_MSG dataPush = new PT_C2S_CHEAT_ADD_REWARD_MSG();
		
		dataPush.Reset();
		
		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
	}

	public void C2S_CHEAT_RESOURCE(string url, int amount, System.Action<ResponseModel<object>> Callback)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<object>);
		msg.IsShowError = false;

		PT_C2S_CHEAT_RESOURCE dataPush = new PT_C2S_CHEAT_RESOURCE();

		dataPush.Reset();
		dataPush.MsgID = url;
		dataPush.amount = amount;

		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
	}

    public void C2S_CHEAT_BOSS(string url, int regionId, System.Action<ResponseModel<object>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<object>);
        msg.IsShowError = false;

        PT_C2S_CHEAT_BOSS dataPush = new PT_C2S_CHEAT_BOSS();

        dataPush.Reset();
        dataPush.MsgID = url;
        dataPush.regionId = regionId;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    #region 유저 관련 패킷

    /// <summary>
    /// 길드 가입 패킷
    /// </summary>
    /// <param name="account"></param>
    /// <param name="name"></param>
    /// <param name="GuildType"></param>
    /// <param name="LeaderName"></param>
    /// <param name="Callback"></param>
	public void C2S_USER_JOIN(AuthPlatformID authPlatform, string account, string authToken, string name, System.Action<ResponseModel<UserModel>> Callback, System.Action<ResponseModel<UserModel>> CallbackErr)
	{
		// Initialize NetMsg
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.CallbackErr = CallbackErr;
		msg.Type = typeof(ResponseModel<UserModel>);
		
		// Write Data For Transmit
		PT_C2S_USER_JOIN dataPush = new PT_C2S_USER_JOIN();
		
		dataPush.Reset();
		dataPush.authPlatform = authPlatform;
		dataPush.account = account;
		dataPush.authToken = authToken;
		dataPush.name = name;
		
		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
	}

    #region GSTAR_TEMP
    public void C2S_GSTAR_USER_JOIN(System.Action<ResponseModel<UserModel>> Callback, System.Action<ResponseModel<UserModel>> CallbackErr)
    {
        // Initialize NetMsg
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.CallbackErr = CallbackErr;
        msg.Type = typeof(ResponseModel<UserModel>);

        // Write Data For Transmit
        PT_C2S_GSTAR_USER_JOIN dataPush = new PT_C2S_GSTAR_USER_JOIN();

        dataPush.Reset();

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    public void C2S_GSTAR_ADD_RAIDBOSS(int regionId, System.Action<ResponseModel<UserModel>> Callback)
    {
        // Initialize NetMsg
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<UserModel>);

        // Write Data For Transmit
        PT_C2S_GSTAR_ADD_RAIDBOSS dataPush = new PT_C2S_GSTAR_ADD_RAIDBOSS();

        dataPush.Reset();
        dataPush.regionId = regionId;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    public void C2S_GSTAR_START_RAIDBOSS_BATTLE(int regionId, System.Action<ResponseModel<RaidBossStartModel>> Callback)
    {
        // Initialize NetMsg
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<RaidBossStartModel>);

        // Write Data For Transmit
        PT_C2S_GSTAR_START_RAIDBOSS_BATTLE dataPush = new PT_C2S_GSTAR_START_RAIDBOSS_BATTLE();

        dataPush.Reset();
        dataPush.regionId = regionId;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    public void C2S_GSTAR_END_RAIDBOSS_BATTLE(int regionId, int decHP, int res, System.Action<ResponseModel<UserModel>> Callback)
    {
        // Initialize NetMsg
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<UserModel>);

        // Write Data For Transmit
        PT_C2S_GSTAR_END_RAIDBOSS_BATTTLE dataPush = new PT_C2S_GSTAR_END_RAIDBOSS_BATTTLE();

        dataPush.Reset();
        dataPush.regionId = regionId;
        dataPush.decHP = decHP;
        dataPush.res = res;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }
    #endregion

    /*
    public void C2S_USER_JOIN(AuthPlatformID authPlatform, string account, string authToken, string name, int GuildType, string LeaderName, System.Action<ResponseModel<UserModel>> Callback)
    {
        // Initialize NetMsg
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<UserModel>);

        // Write Data For Transmit
        PT_C2S_USER_JOIN dataPush = new PT_C2S_USER_JOIN();

        dataPush.Reset();
        dataPush.authPlatform = authPlatform;
        dataPush.account = account;
        dataPush.authToken = authToken;
        dataPush.name = name;
        dataPush.GuildLeaderName = LeaderName;
        dataPush.GuildType = GuildType;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }
	*/

    /// <summary>
    /// 로그인 패킷
    /// </summary>
    /// <param name="account"></param>
	public void C2S_LOGIN(AuthPlatformID authPlatform, string account, string authToken, System.Action<ResponseModel<UserModel>> Callback, System.Action<ResponseModel<UserModel>> CallbackErr)
    {
        // Initialize NetMsg
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.CallbackErr = CallbackErr;
        msg.Type = typeof(ResponseModel<UserModel>);

        // Write Data For Transmit
        PT_C2S_LOGIN dataPush = new PT_C2S_LOGIN();

        dataPush.Reset();
        dataPush.authPlatform = authPlatform;
        dataPush.account = account;
        dataPush.authToken = authToken;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

	public void C2S_LOGOUT(System.Action<ResponseModel<object>> Callback)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<object>);

		PT_C2S_LOGOUT dataPush = new PT_C2S_LOGOUT();

		dataPush.Reset();

		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
	}

    /// <summary>
    /// 유저 정보 패킷
    /// </summary>
    /// <param name="Callback"></param>
	public void C2S_LEGION_GET(System.Action<ResponseModel<UserModel>> Callback)
    {
        // Initialize NetMsg
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<UserModel>);

        // Write Data For Transmit
        PT_C2S_LEGION_GET dataPush = new PT_C2S_LEGION_GET();

        dataPush.Reset();

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

	public void C2S_LEGION_FRIEND_GET(long id, System.Action<ResponseModel<UserModel>> Callback)
	{
		// Initialize NetMsg
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<UserModel>);
		
		// Write Data For Transmit
		PT_C2S_LEGION_FRIEND_GET dataPush = new PT_C2S_LEGION_FRIEND_GET();
		
		dataPush.Reset();
		dataPush.id = id;
		
		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
	}
#endregion

    #region 미션 관련 패킷
    /// <summary>
    /// 미션 시작 패킷
    /// </summary>
    /// <param name="mid"></param>
    /// <param name="id"></param>
    /// <param name="gids"></param>
    /// <param name="Callback"></param>
    public void C2S_MISSION_START(int mid, int id, int[] gids, System.Action<ResponseModel<MissionModel>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<MissionModel>);

        PT_C2S_MISSION_START dataPush = new PT_C2S_MISSION_START();
        dataPush.Reset();

        dataPush.mid = mid;
        dataPush.id = id;
        dataPush.gids = gids;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 미션 끝 패킷
    /// </summary>
    /// <param name="mid"></param>
    /// <param name="id"></param>
    /// <param name="p"></param>
	/// <param name="s"></param>
    /// <param name="Callback"></param>
    public void C2S_MISSION_END(int mid, int id, int p, bool s, System.Action<ResponseModel<UserModel>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<UserModel>);

        PT_C2S_MISSION_END dataPush = new PT_C2S_MISSION_END();
        dataPush.Reset();

        dataPush.mid = mid;
        dataPush.id = id;
        dataPush.p = p;
		dataPush.s = s;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 던전 임무 시작
    /// </summary>
    /// <param name="id"></param>
    /// <param name="n"></param>
    /// <param name="gids"></param>
    /// <param name="Callback"></param>
    public void C2S_MISSION_DUN_START(int id, int n, int[] gids, System.Action<ResponseModel<MissionModel>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<MissionModel>);

        PT_C2S_MISSION_DUN_START dataPush = new PT_C2S_MISSION_DUN_START();
        dataPush.Reset();

        dataPush.id = id;
        dataPush.n = n;
        dataPush.gids = gids;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 던전 임무 끝
    /// </summary>
    /// <param name="id"></param>
    /// <param name="n"></param>
    /// <param name="p"></param>
    /// <param name="s"></param>
    /// <param name="Callback"></param>
    public void C2S_MISSION_DUN_END(int id, int n, int p, bool s, System.Action<ResponseModel<UserModel>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<UserModel>);

        PT_C2S_MISSION_DUN_END dataPush = new PT_C2S_MISSION_DUN_END();
        dataPush.Reset();

        dataPush.id = id;
        dataPush.n = n;
        dataPush.s = s;
        dataPush.p = p;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    #endregion

    #region 아이템 관련 패킷
    /// <summary>
    /// 아이템 리스프 패킷
    /// </summary>
    /// <param name="Callback"></param>
	public void C2S_ITEM_LIST<T>(System.Action<ResponseModel<T>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<T>);

        PT_C2S_ITEM_LIST dataPush = new PT_C2S_ITEM_LIST();
        dataPush.Reset();

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 아이템 선물 패킷
    /// </summary>
    /// <param name="mid"></param>
    /// <param name="gid"></param>
    /// <param name="Callback"></param>
	public void C2S_ITEM_PRES<T>(int mid, int gid, System.Action<ResponseModel<T>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<T>);

        PT_C2S_ITEM_PRES dataPush = new PT_C2S_ITEM_PRES();
        dataPush.Reset();
        dataPush.mid = mid;
        dataPush.gid = gid;


        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 아이템 버프 패킷
    /// </summary>
    /// <param name="mid"></param>
    /// <param name="gid"></param>
    /// <param name="Callback"></param>
	public void C2S_ITEM_BUFF<T>(int mid, int gid, System.Action<ResponseModel<T>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<T>);

        PT_C2S_ITEM_BUFF dataPush = new PT_C2S_ITEM_BUFF();
        dataPush.Reset();
        dataPush.mid = mid;
        dataPush.gid = gid;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 아이템 스킬 패킷
    /// </summary>
    /// <param name="mid"></param>
    /// <param name="gid"></param>
    /// <param name="Callback"></param>
	public void C2S_ITEM_SKILL<T>(int mid, int gid, System.Action<ResponseModel<T>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<T>);

        PT_C2S_ITEM_SKILL dataPush = new PT_C2S_ITEM_SKILL();
        dataPush.Reset();
        dataPush.mid = mid;
        dataPush.gid = gid;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 아이템 기호 패킷
    /// </summary>
    /// <param name="mid"></param>
    /// <param name="gid"></param>
    /// <param name="Callback"></param>
	public void C2S_ITEM_SYMBOL<T>(int mid, int gid, System.Action<ResponseModel<T>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<T>);

        PT_C2S_ITEM_SYMBOL dataPush = new PT_C2S_ITEM_SYMBOL();
        dataPush.Reset();
        dataPush.mid = mid;
        dataPush.gid = gid;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 아이템 장착
    /// </summary>
    /// <param name="gid"></param>
    /// <param name="invslotid"></param>
    /// <param name="itemid"></param>
    /// <param name="amount"></param>
    public void C2S_ITEM_WEAR(int itemSid, int memberNo, System.Action<ResponseModel<UserModel>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.CallbackErr = Callback;
		msg.Type = typeof(ResponseModel<UserModel>);

        PT_C2S_ITEM_WEAR dataPush = new PT_C2S_ITEM_WEAR();
        dataPush.Reset();
        dataPush.itemSid = itemSid;
        dataPush.memberNo = memberNo;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 아이템 매각
    /// </summary>   
    public void C2S_ITEM_SELL(int[] itemIndex, System.Action<ResponseModel<UserModel>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.CallbackErr = Callback;
        msg.Type = typeof(ResponseModel<UserModel>);

        PT_C2S_ITEM_SELL dataPush = new PT_C2S_ITEM_SELL();
        dataPush.Reset();
        dataPush.itemIndex = itemIndex;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 아이템 강화
    /// </summary>    
    public void C2S_ITEM_STRE(int itemIndex, int memberNum, System.Action<ResponseModel<UserModel>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.CallbackErr = Callback;
        msg.Type = typeof(ResponseModel<UserModel>);

        PT_C2S_ITEM_STRE dataPush = new PT_C2S_ITEM_STRE();
        dataPush.Reset();
        dataPush.itemIndex = itemIndex;
        dataPush.memberNum = memberNum;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 아이템 장착(옷장에서 장착)
    /// </summary>
    /// <param name="gid"></param>
    /// <param name="itemids"></param>
    /// <param name="Callback"></param>
    public void C2S_ITEM_ATTACH(int gid, int[] itemids, System.Action<ResponseModel<MemberModel>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<MemberModel>);
        msg.IsShowError = false;

        PT_C2S_ITEM_ATTACH dataPush = new PT_C2S_ITEM_ATTACH();
        dataPush.Reset();
        dataPush.gid = gid;
        dataPush.itemids = itemids;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }
    #endregion


#region 케릭터관리 패킷
    /// <summary>
    /// 케릭터관리
    /// </summary>
    /// <param name="Callback"></param>
    public void C2S_MEMBER_STRENG(int cardNo, int materialNo, System.Action<ResponseModel<UserModel>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.CallbackErr = Callback;
        msg.Type = typeof(ResponseModel<UserModel>);

        PT_C2S_MEMBER_STRENG dataPush = new PT_C2S_MEMBER_STRENG();
        dataPush.cardNo = cardNo;
        dataPush.materialNo = materialNo;
        dataPush.Reset();

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 케릭터 전투원 4명 리스트
    /// </summary>
    /// <param name="Callback"></param>
    public void C2S_MEMBER_CHOICELIST(System.Action<ResponseModel<List<int>>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.CallbackErr = Callback;
        msg.Type = typeof(ResponseModel<List<int>>);

        PT_C2S_MEMBER_CHOICELIST dataPush = new PT_C2S_MEMBER_CHOICELIST();
        dataPush.Reset();

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 케릭터 전투원 4명 선택
    /// </summary>
    /// <param name="Callback"></param>
    public void C2S_MEMBER_CHOOSE(int[] nos, System.Action<ResponseModel<List<int>>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.CallbackErr = Callback;
        msg.Type = typeof(ResponseModel<List<int>>);

        PT_C2S_MEMBER_CHOOSE dataPush = new PT_C2S_MEMBER_CHOOSE();
        dataPush.Nos = nos;
        dataPush.Reset();

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 케릭터 특성포인트 사용
    /// </summary>
    /// <param name="Callback"></param>
    public void C2S_MEMBER_IncTrait(int no, int traitID, int value, System.Action<ResponseModel<MemberModel>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.CallbackErr = Callback;
        msg.Type = typeof(ResponseModel<MemberModel>);

        PT_C2S_MEMBER_IncTrait dataPush = new PT_C2S_MEMBER_IncTrait();
        dataPush.no = no;
        dataPush.traitID = traitID;
        dataPush.value = value;
        dataPush.Reset();

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }


    /// <summary>
    /// 케릭터 특성포인트 초기화
    /// </summary>
    /// <param name="Callback"></param>
    public void C2S_MEMBER_InitTrait(int no, System.Action<ResponseModel<MemberModel>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.CallbackErr = Callback;
        msg.Type = typeof(ResponseModel<MemberModel>);

        PT_C2S_MEMBER_InitTrait dataPush = new PT_C2S_MEMBER_InitTrait();
        dataPush.no = no;       
        dataPush.Reset();

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 케릭터 해고
    /// </summary>
    /// <param name="Callback"></param>
    public void C2S_MEMBER_Disch(int no, System.Action<ResponseModel<UserModel>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.CallbackErr = Callback;
        msg.Type = typeof(ResponseModel<UserModel>);

        PT_C2S_MEMBER_Disch dataPush = new PT_C2S_MEMBER_Disch();
        dataPush.no = no;       
        dataPush.Reset();

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }


#endregion

    #region 길드원 관련 패킷
    /// <summary>
    /// 길드원 추가
    /// </summary>
    /// <param name="id"></param>
    /// <param name="Callback"></param>
	public void C2S_GUILD_ADD<T>(int id, System.Action<ResponseModel<T>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<T>);

        PT_C2S_GUILD_ADD dataPush = new PT_C2S_GUILD_ADD();
        dataPush.Reset();
        dataPush.id = id;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 길드원 방어군 설정
    /// </summary>
    /// <param name="gnos"></param>
    /// <param name="Callback"></param>
    public void C2S_GUILD_DEFENSE(int[] gnos, System.Action<ResponseModel<object>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<object>);

        PT_C2S_GUILD_DEFENSE dataPush = new PT_C2S_GUILD_DEFENSE();
        dataPush.Reset();
        dataPush.gnos = gnos;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 길드원 골드 등용.(리스팅)
    /// </summary>
    /// <param name="Callback"></param>
    public void C2S_GUILD_EMPLIST(bool c, System.Action<ResponseModel<GuildEmpListResultModel>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<GuildEmpListResultModel>);

        PT_C2S_GUILD_EMPLIST dataPush = new PT_C2S_GUILD_EMPLIST();
        dataPush.c = c;
        dataPush.Reset();

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 길드원 골드 등용. 
    /// </summary>
    /// <param name="Callback"></param>
    public void C2S_GUILD_EMPLOY(int no, System.Action<ResponseModel<UserModel>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.CallbackErr = Callback;
		msg.Type = typeof(ResponseModel<UserModel>);

        PT_C2S_GUILD_EMPLOY dataPush = new PT_C2S_GUILD_EMPLOY();
        dataPush.no = no;
        dataPush.Reset(); 

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }


    /// <summary>
    /// 길드원 등용 철회
    /// </summary>
    /// <param name="Callback"></param>
    public void C2S_GUILD_DISCH(int no, System.Action<ResponseModel<UserModel>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.CallbackErr = Callback;
        msg.Type = typeof(ResponseModel<UserModel>);

        PT_C2S_GUILD_DISCH dataPush = new PT_C2S_GUILD_DISCH();
        dataPush.no = no;
        dataPush.Reset();

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 경매 현재 최고가 새로고침
    /// </summary>
    /// <param name="Callback"></param>
    public void C2S_GUILD_AUCTIONINFO(System.Action<ResponseModel<AuctionInfoModel>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<AuctionInfoModel>);

        PT_C2S_GUILD_AUCTIONINFO dataPush = new PT_C2S_GUILD_AUCTIONINFO();
        dataPush.Reset();

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 경매 입찰하기
    /// </summary>
    /// <param name="id"></param>
    /// <param name="p"></param>
    /// <param name="Callback"></param>
    public void C2S_GUILD_TENDER(int id, int p, System.Action<ResponseModel<object>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<object>);

        PT_C2S_GUILD_TENDER dataPush = new PT_C2S_GUILD_TENDER();
        dataPush.Reset();
        dataPush.id = id;
        dataPush.p = p;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }



    /// <summary>
    /// 방랑 길드원 정보요청
    /// </summary>
    /// <param name="Callback"></param>
    public void C2S_GUILD_MASTERY(System.Action<ResponseModel<MemberModel>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<MemberModel>);

        PT_C2S_GUILD_MASTERY dataPush = new PT_C2S_GUILD_MASTERY();
        dataPush.Reset();

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 방랑길드원 고용
    /// </summary>
    /// <param name="Is"></param>
    /// <param name="Callback"></param>
    public void C2S_GUILD_APPOINTMENT(bool Is, System.Action<ResponseModel<UserModel>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<UserModel>);

        PT_C2S_GUILD_APPOINTMENT dataPush = new PT_C2S_GUILD_APPOINTMENT();
        dataPush.Reset();
        dataPush.Is = Is;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }
    #endregion

    #region PVP전투 관련 패킷
    /// <summary>
    /// PVP 리스트 검색
    /// </summary>
    /// <param name="id"></param>
    /// <param name="Callback"></param>
    public void C2S_PVP_LIST(int rid, System.Action<ResponseModel<List<PvpListModelContent>>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<List<PvpListModelContent>>);

        PT_C2S_PVP_LIST dataPush = new PT_C2S_PVP_LIST();
        dataPush.Reset();
        dataPush.rid = rid;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
	}
    #endregion

    #region 정책
    /// <summary>
    /// 정책 시작
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <param name="c"></param>
    /// <param name="Callback"></param>
    public void C2S_POLICY_START(int pno, bool c, System.Action<ResponseModel<UserModel>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<UserModel>);
		msg.IsShowError = false;

        PT_C2S_POLICY_START dataPush = new PT_C2S_POLICY_START();
        dataPush.Reset();
        dataPush.pno = pno;
        dataPush.c = c;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 매수
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <param name="gno"></param>
    /// <param name="Callback"></param>
	public void C2S_POLICY_CORRUPT(int gno, System.Action<ResponseModel<object>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<object>);
		msg.IsShowError = false;

        PT_C2S_POLICY_CORRUPT dataPush = new PT_C2S_POLICY_CORRUPT();
        dataPush.Reset();
        dataPush.gno = gno;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 협박
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <param name="gno"></param>
    /// <param name="Callback"></param>
	public void C2S_POLICY_MENACE(int gno, System.Action<ResponseModel<object>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<object>);
		msg.IsShowError = false;

        PT_C2S_POLICY_MENACE dataPush = new PT_C2S_POLICY_MENACE();
        dataPush.Reset();
        dataPush.gno = gno;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 투표하기
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <param name="pno"></param>
    /// <param name="Callback"></param>
    public void C2S_POLICY_VOTE(byte pno, System.Action<ResponseModel<UserModel>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<UserModel>);

        PT_C2S_POLICY_VOTE dataPush = new PT_C2S_POLICY_VOTE();
        dataPush.Reset();
        dataPush.pno = pno;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 정책 철회
    /// </summary>
    /// <param name="Callback"></param>
    public void C2S_POLICY_REPEAL(System.Action<ResponseModel<object>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<object>);

        PT_C2S_POLICY_REPEAL dataPush = new PT_C2S_POLICY_REPEAL();
        dataPush.Reset();

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    #endregion

    #region 이벤트
    /// <summary>
    /// 새잡기 이벤트
    /// </summary>
    /// <param name="pno"></param>
    /// <param name="c"></param>
    /// <param name="Callback"></param>
    public void C2S_EVENT_CATCH(int r, System.Action<ResponseModel<System.Object>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<System.Object>);
		msg.IsShowError = false;

        PT_C2S_EVENT_CATCH dataPush = new PT_C2S_EVENT_CATCH();
        dataPush.Reset();
        dataPush.r = r;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    #endregion

    #region 캐쉬

    /// <summary>
    /// 캐쉬 사용
    /// </summary>
    /// <param name="pno"></param>
    /// <param name="c"></param>
    /// <param name="Callback"></param>
    public void C2S_CASH_USE(byte type, int amount, System.Action<ResponseModel<System.Object>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<System.Object>);
		msg.IsShowError = false;

        PT_C2S_CASH_USE dataPush = new PT_C2S_CASH_USE();
        dataPush.Reset();
        dataPush.type = type;
        dataPush.amount = amount;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    /// <summary>
    /// 캐쉬 사용
    /// </summary>
    /// <param name="cash"></param>
    /// <param name="store"></param>
    /// <param name="receipt"></param>
    /// <param name="e"></param>
    /// <param name="Callback"></param>
    public void C2S_CASH_BUY(int cash, byte store, string receipt, bool e, System.Action<ResponseModel<System.Object>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<System.Object>);
        msg.IsShowError = false;

        PT_C2S_CASH_BUY dataPush = new PT_C2S_CASH_BUY();
        dataPush.Reset();
        dataPush.cash = cash;
        dataPush.store = store;
        dataPush.receipt = receipt;
        dataPush.e = e;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }
    #endregion

	#region 퀘스트
	public void C2S_QUEST_LIST(System.Action<ResponseModel<List<QuestModel>>> Callback)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<List<QuestModel>>);
		msg.IsShowError = false;

		PT_C2S_QUEST_LIST dataPush = new PT_C2S_QUEST_LIST();
		dataPush.Reset();

		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
	}

	public void C2S_QUEST_COMPLETE(int[] ids, System.Action<ResponseModel<UserModel>> Callback)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<UserModel>);
		msg.IsShowError = false;

		PT_C2S_QUEST_COMPLETE dataPush = new PT_C2S_QUEST_COMPLETE();
		dataPush.Reset();
		dataPush.ids = ids;

		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
	}

	public void C2S_QUEST_WEEK(System.Action<ResponseModel<DailyQuestModel>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<DailyQuestModel>);
		msg.IsShowError = false;

        PT_C2S_QUEST_WEEK dataPush = new PT_C2S_QUEST_WEEK();
        dataPush.Reset();

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }
	#endregion

	#region 지역 관련 패킷
	public void C2S_SEND_TO_RESEARCH(System.Action<ResponseModel<ResearchStartModel>> Callback, int regionId, int[] memberList, long[] friendInfo = null)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<ResearchStartModel>);
		msg.IsShowError = false;
		
		PT_C2S_SEND_RESEARCH dataPush = new PT_C2S_SEND_RESEARCH();
		dataPush.Reset();
		dataPush.regionID = regionId;
		dataPush.memberIds = memberList;
		dataPush.friendInfo = friendInfo;
		
		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);

	}

	public void C2S_SEND_TO_RESEARCH_RESULT(System.Action<ResponseModel<ResearchResultModel>> Callback, int regionId, int battleResult, int[] seqNo, int[] seqType)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<ResearchResultModel>);
		msg.IsShowError = false;
		
		PT_C2S_SEND_RESEARCH_RESULT dataPush = new PT_C2S_SEND_RESEARCH_RESULT();
		dataPush.Reset();
		dataPush.regionID = regionId;
		dataPush.battleResult = battleResult;
		dataPush.seqNo = seqNo;
		dataPush.seqType = seqType;
		
		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
	}

	public void C2S_SEND_TO_EXPANSION(System.Action<ResponseModel<ExpansionWarStartModel>> Callback, int regionId, int step, int[] memberList, long[] friendInfo = null)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<ExpansionWarStartModel>);
		msg.IsShowError = false;
		
		PT_C2S_SEND_EXPANSION dataPush = new PT_C2S_SEND_EXPANSION();
		dataPush.Reset();
		dataPush.regionID = regionId;
		dataPush.step = step;
		dataPush.memberIds = memberList;
		dataPush.friendInfo = friendInfo;
		
		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
		
	}
	
	public void C2S_SEND_TO_EXPANSION_RESULT(System.Action<ResponseModel<ExpansionWarResultModel>> Callback, int regionId, int step, int battleResult)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<ExpansionWarResultModel>);
		msg.IsShowError = false;
		
		PT_C2S_SEND_EXPANSION_RESULT dataPush = new PT_C2S_SEND_EXPANSION_RESULT();
		dataPush.Reset();
		dataPush.regionID = regionId;
		dataPush.step = step;
		dataPush.battleResult = battleResult;
		
		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
	}

	public void C2S_GET_DISPATCH_INFO(System.Action<ResponseModel<Region>> Callback, int regionId, int[] memberList)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<Region>);
		msg.IsShowError = false;
		
		PT_C2S_GET_DISPATCH_INFO dataPush = new PT_C2S_GET_DISPATCH_INFO();
		dataPush.Reset();
		dataPush.regionID = regionId;
		dataPush.memberIds = memberList;
		
		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
	}

	public void C2S_SEND_TO_DISPATCH(System.Action<ResponseModel<Region>> Callback, int regionId, int[] memberList)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<Region>);
		msg.IsShowError = false;
		
		PT_C2S_SEND_DISPATCH dataPush = new PT_C2S_SEND_DISPATCH();
		dataPush.Reset();
		dataPush.regionID = regionId;
		dataPush.memberIds = memberList;
		
		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
	}
	
	public void C2S_COMPLETE_DISPTCH(System.Action<ResponseModel<DispatchCompleteResultModel>> Callback, int regionId)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<DispatchCompleteResultModel>);
		msg.IsShowError = false;
		
		PT_C2S_COMPLETE_DISPATCH dataPush = new PT_C2S_COMPLETE_DISPATCH();
		dataPush.Reset();
		dataPush.regionID = regionId;
		
		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
	}

	public void C2S_CANCEL_DISPTCH(System.Action<ResponseModel<DispatchCompleteResultModel>> Callback, int regionId)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<DispatchCompleteResultModel>);
		msg.IsShowError = false;
		
		PT_C2S_CANCEL_DISPATCH dataPush = new PT_C2S_CANCEL_DISPATCH();
		dataPush.Reset();
		dataPush.regionID = regionId;
		
		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
	}
	#endregion

    #region 20인 대전 관련
    public void C2S_Apply_20BattleFormation(System.Action<ResponseModel<string>> Callback, int[] formation)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<string>);
		msg.IsShowError = false;

        PT_C2S_Apply_20BattleFormation dataPush = new PT_C2S_Apply_20BattleFormation();
		dataPush.Reset();
        dataPush.Formation = formation;
		
		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
	}
	#endregion


    #region 상점 관련 패킷
    public void C2S_BUY_STORE_ITEM(System.Action<ResponseModel<BuyStoreItemResultModel>> Callback, int goodId, bool useSale = false)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<BuyStoreItemResultModel>);
        msg.IsShowError = false;

        PT_C2S_BUY_STORE_ITEM dataPush = new PT_C2S_BUY_STORE_ITEM();

        dataPush.Reset();
        dataPush.goodId = goodId;
        if (useSale == true)
            dataPush.useSale = 1;
        else
            dataPush.useSale = 0;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }
    #endregion

    #region 퀘스트 관련 패킷
    public void C2S_GET_QUESTINFO(System.Action<ResponseModel<QuestResponseModel>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<QuestResponseModel>);
        msg.IsShowError = false;

        PT_C2S_GET_QUEST_INFO dataPush = new PT_C2S_GET_QUEST_INFO();

        dataPush.Reset();

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    public void C2S_START_QUEST(System.Action<ResponseModel<QuestResponseModel>> Callback, int questId)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<QuestResponseModel>);
        msg.IsShowError = false;

        PT_C2S_START_QUEST dataPush = new PT_C2S_START_QUEST();

        dataPush.Reset();
        dataPush.questId = questId;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    public void C2S_GET_QUEST_REWARD(System.Action<ResponseModel<QuestRewardReponseModel>> Callback, int questId)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<QuestRewardReponseModel>);
        msg.IsShowError = false;

        PT_C2S_GET_QUEST_REWARD dataPush = new PT_C2S_GET_QUEST_REWARD();

        dataPush.Reset();
        dataPush.questId = questId;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }
    #endregion

    #region 업적 관련 패킷
    public void C2S_GET_ACHIEVEMENT_LIST(System.Action<ResponseModel<List<Achievement>>> Callback, int type)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<List<Achievement>>);
        msg.IsShowError = false;

        PT_C2S_GET_ACHIEVEMENT_LIST dataPush = new PT_C2S_GET_ACHIEVEMENT_LIST();

        dataPush.Reset();
        dataPush.type = type;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    public void C2S_GET_ACHIEVEMENT_REWARD(System.Action<ResponseModel<UserModel>> Callback, int id)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<UserModel>);
        msg.IsShowError = false;

        PT_C2S_GET_ACHIEVEMENT_REWARD dataPush = new PT_C2S_GET_ACHIEVEMENT_REWARD();

        dataPush.Reset();
        dataPush.id = id;

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }
    #endregion

    #region 임시
    public void C2S_SITE_INCR(System.Action<ResponseModel<System.Object>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<System.Object>);

        PT_C2S_SITE_INCR dataPush = new PT_C2S_SITE_INCR();
        dataPush.Reset();

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }

    public void C2S_USER_SITE(System.Action<ResponseModel<System.Object>> Callback)
    {
        NetMsg msg = new NetMsg();
        msg.Reset();
        msg.CallbackAck = Callback;
        msg.Type = typeof(ResponseModel<System.Object>);

        PT_C2S_USER_SITE dataPush = new PT_C2S_USER_SITE();
        dataPush.Reset();

        dataPush.PushData(ref msg);
        PushPacketToTrasmitQue(msg);
    }
    #endregion

	public void C2S_ALRAMCOUNT_CLEAR(int ts, System.Action<ResponseModel<System.Object>> Callback)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<System.Object>);
		
		PT_C2S_ALRAMCOUNT_CLEAR dataPush = new PT_C2S_ALRAMCOUNT_CLEAR();
		dataPush.Reset();
		dataPush.ts = ts;

		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
	}
}
